package jp.sinya.custom_jstl;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
import java.io.Writer;

/**
 * SimpleTagSupport 已经实现了SimpleTag接口
 * 还提供了get方法获取
 */
public class CustomTag3 extends SimpleTagSupport {
    @Override
    public void doTag() throws JspException, IOException {
        //获取当前页面的输出流
        Writer out = this.getJspContext().getOut();
        out.write("====↓ 输出的内容 ↓====<br/>");
        //执行内容输出到页面上
        this.getJspBody().invoke(out);
        out.write("<br/>");
        out.write("====↑ 输出的内容 ↑====<br/>");
    }
}
